package com.greentreecs.fms.constant;

import com.greentreecs.fms.pojo.domain.FeeGenerateDO;
import com.greentreecs.fms.pojo.domain.IncGenerateDO;
import com.greentreecs.fms.pojo.domain.OutcGenerateDO;
import com.greentreecs.fms.pojo.dto.IncOutcBalanceDTO;
import com.greentreecs.fms.pojo.param.TableAttrParam;

/**
 * @author 刀氏春秋
 * @date 2023/12/4
 */
public class TableQueryParamConstant {
    /**
     * 当日费用发生表参数模板
     */
    public static final TableAttrParam DAY_FEE_GEN_PARAM_TEMP =
            TableAttrParam.builder()
                    .doClass(FeeGenerateDO.class)
                    .baseDir(OriginTableConstant.BASE_DIR)
                    .tableName(OriginTableConstant.FEE_DAY_GENERATE_TABLE)
                    .fileType(OriginTableConstant.TABLE_FILE_TYPE)
                    .headerRowNum(OriginTableConstant.FEE_DAY_GENERATE_TABLE_HEADER).build();

    /**
     * 当日支出费用发生表参数模板
     */
    public static final TableAttrParam DAY_INC_GEN_PARAM_TEMP =
            TableAttrParam.builder()
                    .doClass(IncGenerateDO.class)
                    .baseDir(OriginTableConstant.BASE_DIR)
                    .tableName(OriginTableConstant.DAY_ROOM_INCOME_TABLE)
                    .fileType(OriginTableConstant.TABLE_FILE_TYPE)
                    .headerRowNum(OriginTableConstant.DAY_ROOM_INCOME_TABLE_HEADER).build();

    /**
     * 当日支出费用发生表参数模板
     */
    public static final TableAttrParam DAY_OUTC_GEN_PARAM_TEMP =
            TableAttrParam.builder()
                    .doClass(OutcGenerateDO.class)
                    .baseDir(OriginTableConstant.BASE_DIR)
                    .tableName(OriginTableConstant.DAY_ROOM_OUTCOME_TABLE)
                    .fileType(OriginTableConstant.TABLE_FILE_TYPE)
                    .headerRowNum(OriginTableConstant.DAY_ROOM_OUTCOME_TABLE_HEADER).build();

    public static final TableAttrParam HISTORY_INC_OUTC_BAL_PARAM_TEMP =
            TableAttrParam.builder()
                    .doClass(IncOutcBalanceDTO.class)
                    .baseDir(ReportTableConstant.INC_OUTC_BAL_BASE_DIR)
                    .tableName(ReportTableConstant.HISTORY_INC_OUTC_BAL_TABLE)
                    .fileType(ReportTableConstant.TABLE_FILE_TYPE)
                    .headerRowNum(ReportTableConstant.HISTORY_INC_OUTC_BAL_TABLE_HEADER).build();

    /**
     * 为所有参数模板设置日期时间
     *
     * @param time 日期时间
     */
    public static void setAllDateTime(String time) {
        DAY_FEE_GEN_PARAM_TEMP.setTime(time);
        DAY_INC_GEN_PARAM_TEMP.setTime(time);
        DAY_OUTC_GEN_PARAM_TEMP.setTime(time);
    }
}
